/**
 * Excel导出功能示例模块，这些只是示例
 * 提供各种导出场景的示例代码
 */

import { exportExcel, exportExcelByGet, batchExportExcel } from './excelExport'

/**
 * 导出物品清单
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function exportCommodityList(params) {
  return exportExcel('/inventory/commodity/export', params)
}

/**
 * 导出入库单
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function exportEnterOrderList(params) {
  return exportExcel('/inbound/enter-order/export', params, '入库单导出.xlsx')
}

/**
 * 导出出库单
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function exportOutboundOrderList(params) {
  return exportExcel('/outbound/order/export', params)
}

/**
 * 导出库存报表
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function exportInventoryReport(params) {
  return exportExcel('/inventory/statistics/export', params, '库存报表.xlsx')
}

/**
 * 导出供应商列表(使用GET方法示例)
 * @param {Object} params - 查询参数
 * @returns {Promise}
 */
export function exportSupplierList(params) {
  return exportExcelByGet('/basic/supplier/export', params)
}

/**
 * 批量导出多种报表(示例)
 * @param {Object} inventoryParams - 库存报表参数
 * @param {Object} commodityParams - 物品清单参数
 * @returns {Promise}
 */
export function exportMultipleReports(inventoryParams, commodityParams) {
  const exportTasks = [
    {
      url: '/inventory/statistics/export',
      params: inventoryParams,
      fileName: '库存报表.xlsx'
    },
    {
      url: '/inventory/commodity/export',
      params: commodityParams,
      fileName: '物品清单.xlsx'
    }
  ]
  
  return batchExportExcel(exportTasks, true) // 顺序导出
} 